package com.db.priceApp.service;

import com.db.priceApp.domain.Price;

public class MessageCostructor {

	public MessageCostructor() {
	}
	
	public static byte[] createLoginReportMessage(String login) {
		String buffer = new String("35=A|49=" + login);

		return buffer.getBytes();
	}
	
	public static byte[] createLoginRejectMessage(String text) {
		String buffer = new String("35=5|58=" + text);

		return buffer.getBytes();
	}
	
	public static byte[] createPriceReportMessage(String instrName, Price price, long time) {
		
		String buffer = new String("35=V|48=" + instrName + "|44=" + price + "|60=" + time);

		return buffer.getBytes();
	}
	
	public static byte[] createPriceReportMessage(String instrName, float price, long time) {
		
		String buffer = new String("35=V|48=" + instrName + "|44=" + price + "|60=" + time);

		return buffer.getBytes();
	}
	
	public static byte[] createRejectMessage(String text) {
		String buffer = new String("35=Y|58=" + text);

		return buffer.getBytes();
	}
	
	public static byte[] createSubscribeRequest(String instrName) {
		String buffer = new String("35=e|48=" + instrName);

		return buffer.getBytes();
	}
	

	public static byte[] createUnsubscribeRequest(String instrName) {
		String buffer = new String("35=U|48=" + instrName);

		return buffer.getBytes();
	}
}